<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看</title>
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
    <script  type ="text/javascript" src="../../res/js/jquery-3.4.1.min.js"></script>
    <script src="../../layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src ="../../res/js/Tools.js"></script>

</head>
<body>
    <div style="padding: 20px;">
        <h3 id="attachName" style="text-align: center"></h3>
        <hr/>
        <div style="text-align: center">
            <em id="attachTime" style="margin: 10px"></em>
            <em id ="attachPublisher" style="margin: 10px"></em>
        </div>
        <div id="attachContent" style="text-align: center">

        </div>
        <div id="file">

        </div>
    </div>
</body>
<script type="text/javascript">
    var url = "../../../atsAttachmentController/findById";
    var data = {attachId : getQueryString("attachId")};

    $.post(url,data,function(obj){
        $('#attachName').html("标题："+obj.attachName);
        $('#attachTime').html("发布时间:"+obj.attachTime);
        $('#attachPublisher').html("发布人:"+obj.attachPublisher);
        $('#attachContent').html(obj.attachContent);
        if(obj.file1 !=null && trim(obj.file1) !=""){
            $('#file').append("<a title="+obj.file1+" target='_blank' href="+'../../..'+obj.file1+" class='layui-btn layui-btn-sm'>附件1下载</a>");
        }
        if(obj.file2 !=null && trim(obj.file2) !=""){
            $('#file').append("<a title="+obj.file2+" target='_blank' href="+'../../..'+obj.file2+"  class='layui-btn layui-btn-sm'>附件2下载</a>");
        }
        if(obj.file3 !=null && trim(obj.file3) !=""){
            $('#file').append("<a title="+obj.file3+" target='_blank' href="+'../../..'+obj.file3+"  class='layui-btn layui-btn-sm'>附件3下载</a>");
        }
    });
    //去除两边空格
    function trim(str){
        return str.replace(/(^\s*)|(\s*$)/g, "");
    }
</script>

</html>